home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / ddj0492.zip / HANDPRIN.URC / Recognizer / Wacom.h < prev   
Text File  |  1989-10-02  |  8KB  |  206 lines

  1. /* ********** Wacom Serial Tablet Driver Interface Definitions ********* */
  2. /*                                                                       */
  3. /*                        Copyright (C) 1988, 1989                       */
  4. /*                      Evergreen Technologies, Inc.                     */
  5. /*                          All Rights Reserved                          */
  6. /*                                                                       */
  7. /*                                                                       */
  8. /* ********************************************************************* */
  9.  
  10.  
  11. /* ***** Structures for associating stylus buttons with keys ***** */
  12.  
  13. typedef struct button {            /* definition for a single button */
  14.     Boolean ignored;            /* this button is ignored by the driver */
  15.     int        key;                /* key representation of what is generated */
  16. } BUTTON;                        /* ...when the button is pressed - this is */
  17.                                 /* ...meant to be a function key, but a */
  18.                                 /* ...developer can put anything here that */
  19.                                 /* ...they want to;  the CDEV only puts */
  20.                                 /* ...function key press data here; if key */
  21.                                 /* ...is zero then this button is mapped to */
  22.                                 /* ...the mouse button */
  23.                                 
  24. typedef struct bmap {                    /* structure containing all buttons */
  25.     BUTTON    penDown;            /* point button in the pens */
  26.     BUTTON    sideSwitch;            /* side button of the standard pen */
  27.     BUTTON    cursor[4];            /* each of the 4 cursor buttons */
  28. } BMAP;
  29.  
  30.  
  31.  
  32. /* ***** Standard Data Structure For Tablet Access *****
  33.  *
  34.  *  Based on:
  35.  *            "Proposed ADB Tablet Memory Structure"
  36.  *                        Dec. 19, 1988
  37.  *                 Dave Fleck, GTCO Corporation
  38.  *
  39.  */
  40.  
  41. typedef struct tabletRecord {
  42.  
  43.     /* *** Header section *** */
  44.     
  45.     char    version;            /* version of this data format */
  46.     char    semaphore;            /* for future use -- tells if drvr is enabled */
  47.     char    cursors;            /* number of cursors with tablet */
  48.     char    updateFlags;        /* flags used when updating structure */
  49.     int        angleRes;            /* metric bit & angular resolution */
  50.     int        spaceRes;            /* spatial resolution of the tablet */
  51.     long    xDimension;            /* x dimension in resolution units */
  52.     long    yDimension;            /* y dimension in resolution units */
  53.     long    zDimension;            /* z dimension in resolution units */
  54.     long    xDisplace;            /* x displacement - minimum x value */
  55.     long    yDisplace;            /* y displacement - minimum y value */
  56.     long    zDisplace;            /* z displacement - minimum z value */
  57.     long    resvPtr;            /* reserved pointer for future use */
  58.     long    tabletID;            /* contains 'TBLT' identifying the device */
  59.     
  60.     /* *** Cursor section *** */
  61.     
  62.     char    DOFFlag;            /* degrees of freedom and transducer type */
  63.     char    orientFlag;            /* type of orientation information */
  64.     int        pressLevels;        /* pressure support and number of levels */
  65.     int        xScale;                /* x scale factor for screen mapping */
  66.     int        xTrans;                /* x translation factor for screen */
  67.     int        yScale;                /* y scale factor for screen mapping */
  68.     int        yTrans;                /* y translation factor for screen */
  69.     char    flags;                /* proximity, update flag, and # buttons */
  70.     char    pressThresh;        /* pressure threshold - normally unused */
  71.     int        buttonMask;            /* button mask of driver-reserved buttons */
  72.     int        errorFlag;            /* error code generated */
  73.     int        buttons;            /* buttons pressed */
  74.     int        tangPress;            /* tangential pressure level */
  75.     int        pressure;            /* normal pressure level */
  76.     long    timeStamp;            /* ticks at latest update */
  77.     long    xCoord;                /* x coordinate in resolution units */
  78.     long    yCoord;                /* y coordinate in resolution units */
  79.     long    zCoord;                /* z coordinate in resolution units */
  80.     int        xTilt;                /* x tilt */
  81.     int        yTilt;                /* y tilt */
  82.                                 /* the specification calls for 8 more */
  83.                                 /* ...integers containing an attitude */
  84.                                 /* ...matrix.  This driver does not use */
  85.                                 /* ...the attitude matrix so these 16  */
  86.                                 /* ...bytes are re-allocated as described */
  87.     int        tabXMin;            /* minimum tablet x dimension mapped */
  88.     int        tabYMin;            /* minimum tablet y dimension mapped */
  89.     int        tabXMax;            /* maximum tablet x dimension mapped */
  90.     int        tabYMax;            /* maximum tablet y dimension mapped */
  91.     int        screenXMin;            /* minimum screen x dimension mapped */
  92.     int        screenYMin;            /* minimum screen y dimension mapped */
  93.     int        screenXMax;            /* maximum screen x dimension mapped */
  94.     int        screenYMax;            /* maximum screen y dimension mapped */
  95.                                 /* finally, the additional fields were */
  96.                                 /* ...added as an addition to the */
  97.                                 /* ... proposed specification to handle */
  98.                                 /* ... Wacom-specific needs */
  99.     BMAP    *buttonMapping;        /* pointer to button mapping structure */
  100.     int        modelInUse;            /* the Wacom tablet model currently in use */
  101.  
  102. } TABLETRECORD;
  103.  
  104.  
  105.  
  106. /* ***** Flags used within a TABLETRECORD *****
  107.  *
  108.  */
  109.  
  110.         /* updateFlags flags */
  111. #define FRESHDATA    0x04        /* new data loaded */
  112. #define FRESHATTR    0x08        /* new attributes loaded */
  113. #define CHANGEDDATA    0x40        /* application has changed data */
  114. #define CHANGEDATTR    0x80        /* application has changed attributes */
  115.  
  116.         /* tranducer types */
  117. #define UNKNOWN        0x00
  118. #define PEN            0x01
  119. #define CURSOR        0x02
  120.  
  121.         /* degrees of freedom flags */
  122. #define DOFX        0x08
  123. #define DOFY        0x04
  124. #define DOFZ        0x02
  125.  
  126.         /* orientation type flags */
  127. #define NOATTITUDE    0x00        /* no transducer orientation info */
  128. #define ATTITUDE    0x01        /* structure contains attitude matrix */
  129. #define TILT        0x02        /* tilt information is available */
  130.  
  131.         /* general flags */
  132. #define PROXIMITY    0x80        /* is the transducer within proximity */
  133. #define TRACKING    0x40        /* is driver tracking the mouse cursor; 0 = YES */
  134.  
  135.         /* errorFlag's used by the Wacom driver */
  136. #define NOERROR        0x00        /* no error has occurred */
  137. #define PORTERROR    0x01        /* error in controlling the serial port */
  138. #define NORESPONSE    0x02        /* tablet is not responding */
  139.  
  140.  
  141.  
  142.  
  143. /* ***** Configuration Structure Used By CDEV ***** */
  144.  
  145. typedef struct config {
  146.     Boolean driverEnabled;        /* TRUE if driver should be enabled */
  147.     Boolean fullTablet;            /* TRUE if full tablet should be used */
  148.     Boolean fullScreen;            /* TRUE if full screen should be used */
  149.     int tabX1,tabY1;            /* upper left of tablet in use */
  150.     int tabX2,tabY2;            /* lower right of tablet in use */
  151.     int screenX1,screenY1;        /* upper left of screen in use */
  152.     int screenX2,screenY2;        /* lower right of screen in use */
  153.     Boolean updateCursor;        /* TRUE if tablet should move cursor */
  154.     Boolean pressurePen;        /* TRUE if pressure pen is used */
  155.     int pressThresh;            /* pressure threshold of mouse button */
  156.     BMAP buttonMapping;            /* definition of the button mapping */
  157.     int model;                    /* Wacom tablet model identification */
  158. } CONFIG;
  159.  
  160.  
  161.  
  162. /*****
  163.  *  SD Model Information
  164.  *
  165.  */
  166. #define SD210        0
  167. #define    SD210MAXX    31750
  168. #define    SD210MAXY    23100
  169. #define SD31X        1
  170. #define    SD31XMAXX    21200
  171. #define    SD31XMAXY    15000
  172. #define SD320        2
  173. #define    SD320MAXX    19050
  174. #define    SD320MAXY    19050
  175. #define SD420        3
  176. #define    SD420MAXX    15240
  177. #define    SD420MAXY    15240
  178. #define SD510        4
  179. #define    SD510MAXX    6930
  180. #define    SD510MAXY    4620
  181.  
  182.  
  183.  
  184. /* ***** csCode's *****
  185.  *
  186.  */
  187.  
  188. #define GET_RECORD    20                    /* requests the address of the */
  189.                                         /* ...current tablet record */
  190. #define FORCE_BEAT    21                    /* forces a heartbeat - use for */
  191.                                         /* ...forcing parameter updates */
  192. #define START_UP    41                    /* set tablet to startup defaults */
  193.                                         /* ...and begin polling and processing */
  194. #define SHUT_DOWN    42                    /* stop polling and processing */
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201. /* ********************************************************************* */
  202. /*                                                                       */
  203. /*                            End of Wacom.h                             */
  204. /*                                                                       */
  205. /* ********************************************************************* */
  206.